package test;

import static org.junit.Assert.*;
import junit.framework.Assert;
import modele.Point;
import org.junit.Test;

public class testPoint {

	@Test
	public void testgetX() {
		Point p = new Point();
		p.setX(5);
		Assert.assertEquals(5, p.getX());
	}
	
	@Test
	public void testgetY() {
		Point p = new Point();
		p.setY(5);
		Assert.assertEquals(5, p.getY());
	}
	
	@Test
	public void testsymetrieO() {
		Point p = new Point(5,5);
		p.symetrieO(new Point(0,0));
		Assert.assertEquals(-5, p.getX());
		Assert.assertEquals(-5, p.getY());
	}
	
	@Test
	public void testsymetrieX() {
		Point p = new Point(5,5);
		p.symetrieX(new Point(0,0));
		Assert.assertEquals(5, p.getX());
		Assert.assertEquals(-5, p.getY());
	}
	
	@Test
	public void testsymetrieY() {
		Point p = new Point(5,5);
		p.symetrieY(new Point(0,0));
		Assert.assertEquals(-5, p.getX());
		Assert.assertEquals(5, p.getY());
	}
	

	
	@Test
	public void testequals() {
		Point p = new Point(5,9);
		Point q = new Point(5,9);
		Point r = new Point(8,4);
		Assert.assertEquals(true, p.equals(q));
		Assert.assertEquals(false, p.equals(r));
	}
	
	
	@Test
	public void testdistance(){
		Point p = new Point(1,10);
		Point q = new Point(1,5);
		Assert.assertEquals(5.0, p.distance(q));
	}
	
	

}
